Article pages are the primary reading destination on TuPerfil.net. Each article is served atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/santiagodc8/tu_perfil.net/llms.txt
Use this file to discover all available pages before exploring further.
/noticia/{slug} and revalidates every 5 minutes.
src/app/(public)/noticia/[slug]/page.tsx
URL pattern
/noticia/candidato-anuncia-su-postulacion/noticia/nuevo-hospital-regional-inaugurado
notFound().
The Article interface
The canonical TypeScript type for an article is defined insrc/types/index.ts:
src/types/index.ts
What the reader sees
The article page layout, from top to bottom:Breadcrumbs
A trail showing Home › Category name › Article title. The category link navigates to the category page.
Category badge and metadata
A colored pill badge for the category, a “Por ” byline linking to
/autor/{slug}, the publication date (formatted as relative time via smartDate), and the estimated reading time via readingTime.Share buttons (top)
Social sharing buttons via the
ShareButtons component — allows readers to share the article URL.Cover image
If
image_url is set, the cover image is rendered in a 16:9 aspect-ratio container with priority loading and a blur placeholder.Gallery
If the
gallery array has entries, an ImageGallery component renders the additional images below the cover.Article body
The rich HTML content is rendered by the
ArticleBody component, which also includes reading controls (font size adjustment). The body uses Tailwind’s prose classes for typography.Share buttons (bottom)
A second set of share buttons appears after the article body, above the tags.
Floating WhatsApp button
On mobile, a floating WhatsApp share button (FloatingWhatsApp) appears fixed at the bottom of the screen, providing a quick way to share the article via WhatsApp.
View count tracking
Every time a reader opens an article page, theViewCounter client component fires a POST request to /api/views/{article_id} on mount:
src/components/public/ViewCounter.tsx
increment_views Supabase RPC, which atomically increments the article’s views counter and inserts a row into page_views with the referrer source:
src/app/api/views/[id]/route.ts
direct, google, facebook, twitter, whatsapp, instagram, tiktok, telegram, or other. This data powers the traffic analytics visible in the admin panel.
Related articles
The page fetches up to 4 related articles using a two-step strategy:- Tag-based: The
related_articles_by_tagsRPC finds articles that share the most tags with the current article, within the same category. - Category fallback: If fewer than 4 tag-related articles are found, the remainder is filled with recent articles from the same category.
src/app/(public)/noticia/[slug]/page.tsx
RelatedArticles component) below the comments section.
Comments
Readers can leave comments on any published article. Comments require approval before they appear publicly.Submitting a comment
TheCommentForm client component collects name, email, and message, then posts to POST /api/comments:
src/components/public/CommentForm.tsx
- All fields (
article_id,author_name,author_email,content) are required. author_namemust be at least 2 characters.author_emailmust match a basic email regex.contentmust be between 5 and 2,000 characters.- A rate limit of 10 comments per IP per hour is enforced (returns HTTP 429 if exceeded).
Reading comments
TheCommentList component fetches approved comments via GET /api/comments?article_id={uuid}. Only comments with approved = true are returned.
src/app/api/comments/route.ts
The reader’s email address is never displayed publicly. It is stored in the database for admin reference only.
/admin/comentarios.
Structured data (JSON-LD)
Each article page includes aNewsArticle JSON-LD block for search engine rich results:
src/app/(public)/noticia/[slug]/page.tsx
RSS feed
The site publishes an RSS 2.0 feed at/feed.xml. It contains up to 20 of the most recently published articles, revalidated every 5 minutes.
Each feed item includes the article title, URL, excerpt as description, publication date, category, and author name.
published_at <= now() are included — scheduled future articles are excluded.
Sitemap
A dynamic sitemap is generated at/sitemap.xml by src/app/sitemap.ts. It includes:
| Page type | Change frequency | Priority |
|---|---|---|
Home (/) | hourly | 1.0 |
| Category pages | daily | 0.8 |
| Article pages | weekly | 0.6 |
| Contact, about, search | monthly | 0.2–0.3 |
lastModified uses the updated_at timestamp. Future-scheduled articles (where published_at > now()) are excluded from the sitemap.